|
dcmotor30 2.2.0
|
API for configuring and manipulating DC Motor 30 Click driver. More...
Topics | |
| DC Motor 30 Registers List | |
| List of registers of DC Motor 30 Click driver. | |
| DC Motor 30 Registers Settings | |
| Settings for registers of DC Motor 30 Click driver. | |
| DC Motor 30 MikroBUS Map | |
| MikroBUS pin mapping of DC Motor 30 Click driver. | |
Functions | |
| void | dcmotor30_cfg_setup (dcmotor30_cfg_t *cfg) |
| DC Motor 30 configuration object setup function. | |
| err_t | dcmotor30_init (dcmotor30_t *ctx, dcmotor30_cfg_t *cfg) |
| DC Motor 30 initialization function. | |
| err_t | dcmotor30_default_cfg (dcmotor30_t *ctx) |
| DC Motor 30 default configuration function. | |
| err_t | dcmotor30_write_reg (dcmotor30_t *ctx, uint8_t reg, uint8_t data_in) |
| DC Motor 30 write reg function. | |
| err_t | dcmotor30_read_reg (dcmotor30_t *ctx, uint8_t reg, uint8_t *data_out) |
| DC Motor 30 read reg function. | |
| err_t | dcmotor30_read_adc_raw (dcmotor30_t *ctx, uint16_t *data_out) |
| DC Motor 30 read raw IPROPI ADC value function. | |
| err_t | dcmotor30_read_adc_volt (dcmotor30_t *ctx, float *data_out) |
| DC Motor 30 read IPROPI pin voltage level function. | |
| err_t | dcmotor30_read_adc_volt_avg (dcmotor30_t *ctx, uint16_t num_conv, float *volt_avg) |
| DC Motor 30 read IPROPI pin voltage level average function. | |
| err_t | dcmotor30_set_adc_vref (dcmotor30_t *ctx, float vref) |
| DC Motor 30 set vref function. | |
| void | dcmotor30_set_in1_pin (dcmotor30_t *ctx) |
| DC Motor 30 set IN1 pin function. | |
| void | dcmotor30_clear_in1_pin (dcmotor30_t *ctx) |
| DC Motor 30 clear IN1 pin function. | |
| void | dcmotor30_set_in2_pin (dcmotor30_t *ctx) |
| DC Motor 30 set IN2 pin function. | |
| void | dcmotor30_clear_in2_pin (dcmotor30_t *ctx) |
| DC Motor 30 clear IN2 pin function. | |
| uint8_t | dcmotor30_get_fault_pin (dcmotor30_t *ctx) |
| DC Motor 30 get FAULT pin function. | |
| void | dcmotor30_drive_motor (dcmotor30_t *ctx, uint8_t state) |
| DC Motor 30 drive motor function. | |
| err_t | dcmotor30_clear_fault (dcmotor30_t *ctx) |
| DC Motor 30 clear fault function. | |
| err_t | dcmotor30_calib_offset (dcmotor30_t *ctx) |
| DC Motor 30 calib offset function. | |
| err_t | dcmotor30_get_out_current (dcmotor30_t *ctx, float *current) |
| DC Motor 30 get out current function. | |
API for configuring and manipulating DC Motor 30 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| err_t dcmotor30_calib_offset | ( | dcmotor30_t * | ctx | ) |
DC Motor 30 calib offset function.
This function calibrates the zero current offset value.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void dcmotor30_cfg_setup | ( | dcmotor30_cfg_t * | cfg | ) |
DC Motor 30 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See dcmotor30_cfg_t object definition for detailed explanation. |
| err_t dcmotor30_clear_fault | ( | dcmotor30_t * | ctx | ) |
DC Motor 30 clear fault function.
This function clears all latched faults.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void dcmotor30_clear_in1_pin | ( | dcmotor30_t * | ctx | ) |
DC Motor 30 clear IN1 pin function.
This function clears the IN1 pin to low logic state.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| void dcmotor30_clear_in2_pin | ( | dcmotor30_t * | ctx | ) |
DC Motor 30 clear IN2 pin function.
This function clears the IN2 pin to low logic state.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| err_t dcmotor30_default_cfg | ( | dcmotor30_t * | ctx | ) |
DC Motor 30 default configuration function.
This function executes a default configuration of DC Motor 30 Click board.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void dcmotor30_drive_motor | ( | dcmotor30_t * | ctx, |
| uint8_t | state ) |
DC Motor 30 drive motor function.
This function drives the motor in the selected PWM control mode state.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| [in] | state | :
|
| uint8_t dcmotor30_get_fault_pin | ( | dcmotor30_t * | ctx | ) |
DC Motor 30 get FAULT pin function.
This function returns the FAULT pin logic state.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| err_t dcmotor30_get_out_current | ( | dcmotor30_t * | ctx, |
| float * | current ) |
DC Motor 30 get out current function.
This function reads the current output measurement in mA.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| [out] | current | : Current output level [mA]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor30_init | ( | dcmotor30_t * | ctx, |
| dcmotor30_cfg_t * | cfg ) |
DC Motor 30 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See dcmotor30_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor30_read_adc_raw | ( | dcmotor30_t * | ctx, |
| uint16_t * | data_out ) |
DC Motor 30 read raw IPROPI ADC value function.
This function reads results of AD conversion of the IPROPI pin.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| [out] | data_out | : Output ADC result. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor30_read_adc_volt | ( | dcmotor30_t * | ctx, |
| float * | data_out ) |
DC Motor 30 read IPROPI pin voltage level function.
This function reads results of AD conversion of the IPROPI pin and converts them to proportional voltage level.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| [out] | data_out | : Output voltage level of the analog pin [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor30_read_adc_volt_avg | ( | dcmotor30_t * | ctx, |
| uint16_t | num_conv, | ||
| float * | volt_avg ) |
DC Motor 30 read IPROPI pin voltage level average function.
This function a desired number of IPROPI pin ADC voltage samples and averages it.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| [in] | num_conv | : Number of ADC samples. |
| [out] | volt_avg | : Average output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor30_read_reg | ( | dcmotor30_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
DC Motor 30 read reg function.
This function reads a data byte from the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Output read data. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dcmotor30_set_adc_vref | ( | dcmotor30_t * | ctx, |
| float | vref ) |
DC Motor 30 set vref function.
This function sets the ADC voltage reference for DC Motor 30 Click driver.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| [in] | vref | : Reference voltage (volts). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void dcmotor30_set_in1_pin | ( | dcmotor30_t * | ctx | ) |
DC Motor 30 set IN1 pin function.
This function sets the IN1 pin to high logic state.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| void dcmotor30_set_in2_pin | ( | dcmotor30_t * | ctx | ) |
DC Motor 30 set IN2 pin function.
This function sets the IN2 pin to high logic state.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| err_t dcmotor30_write_reg | ( | dcmotor30_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
DC Motor 30 write reg function.
This function writes a data byte to the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See dcmotor30_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.